/* Markdown渲染样式 */

/* 通用markdown容器样式 */
.question-title,
.option-text,
.explanation-content,
.question-text,
.explanation-text {
    line-height: 1.6;
}

/* Markdown标题样式 */
.question-title h1,
.option-text h1,
.explanation-content h1,
.question-text h1,
.explanation-text h1 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.5em 0;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e9ecef;
}

.question-title h2,
.option-text h2,
.explanation-content h2,
.question-text h2,
.explanation-text h2 {
    font-size: 1.3em;
    font-weight: bold;
    margin: 0.5em 0;
    padding-bottom: 0.2em;
    border-bottom: 1px solid #e9ecef;
}

.question-title h3,
.option-text h3,
.explanation-content h3,
.question-text h3,
.explanation-text h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0.4em 0;
}

/* Markdown段落样式 */
.question-title p,
.option-text p,
.explanation-content p,
.question-text p,
.explanation-text p {
    margin: 0.5em 0;
}

/* 最后一个段落不要底部margin */
.question-title p:last-child,
.option-text p:last-child,
.explanation-content p:last-child,
.question-text p:last-child,
.explanation-text p:last-child {
    margin-bottom: 0;
}

/* 第一个段落不要顶部margin */
.question-title p:first-child,
.option-text p:first-child,
.explanation-content p:first-child,
.question-text p:first-child,
.explanation-text p:first-child {
    margin-top: 0;
}

/* Markdown强调样式 */
.question-title strong,
.option-text strong,
.explanation-content strong,
.question-text strong,
.explanation-text strong,
.question-title b,
.option-text b,
.explanation-content b,
.question-text b,
.explanation-text b {
    font-weight: bold;
    color: #2c3e50;
}

.question-title em,
.option-text em,
.explanation-content em,
.question-text em,
.explanation-text em,
.question-title i,
.option-text i,
.explanation-content i,
.question-text i,
.explanation-text i {
    font-style: italic;
    color: #5a6c7d;
}

/* Markdown代码样式 */
.question-title code,
.option-text code,
.explanation-content code,
.question-text code,
.explanation-text code {
    background: #f5f7fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
    border: 1px solid #e9ecef;
}

.question-title pre,
.option-text pre,
.explanation-content pre,
.question-text pre,
.explanation-text pre {
    background: #f5f7fa;
    padding: 12px 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.8em 0;
    border: 1px solid #e9ecef;
}

.question-title pre code,
.option-text pre code,
.explanation-content pre code,
.question-text pre code,
.explanation-text pre code {
    background: none;
    padding: 0;
    border: none;
    color: #333;
}

/* Markdown列表样式 */
.question-title ul,
.option-text ul,
.explanation-content ul,
.question-text ul,
.explanation-text ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
    list-style-type: disc;
}

.question-title ol,
.option-text ol,
.explanation-content ol,
.question-text ol,
.explanation-text ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
    list-style-type: decimal;
}

.question-title li,
.option-text li,
.explanation-content li,
.question-text li,
.explanation-text li {
    margin: 0.3em 0;
}

.question-title ul ul,
.option-text ul ul,
.explanation-content ul ul,
.question-text ul ul,
.explanation-text ul ul,
.question-title ol ol,
.option-text ol ol,
.explanation-content ol ol,
.question-text ol ol,
.explanation-text ol ol {
    margin: 0.2em 0;
}

/* Markdown引用样式 */
.question-title blockquote,
.option-text blockquote,
.explanation-content blockquote,
.question-text blockquote,
.explanation-text blockquote {
    margin: 0.8em 0;
    padding: 8px 15px;
    border-left: 4px solid #667eea;
    background: #f0f4ff;
    color: #5a6c7d;
    border-radius: 4px;
}

.question-title blockquote p,
.option-text blockquote p,
.explanation-content blockquote p,
.question-text blockquote p,
.explanation-text blockquote p {
    margin: 0.3em 0;
}

/* Markdown链接样式 */
.question-title a,
.option-text a,
.explanation-content a,
.question-text a,
.explanation-text a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.question-title a:hover,
.option-text a:hover,
.explanation-content a:hover,
.question-text a:hover,
.explanation-text a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* Markdown表格样式 */
.question-title table,
.option-text table,
.explanation-content table,
.question-text table,
.explanation-text table {
    border-collapse: collapse;
    margin: 0.8em 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.question-title table thead,
.option-text table thead,
.explanation-content table thead,
.question-text table thead,
.explanation-text table thead {
    background: #f5f7fa;
}

.question-title table th,
.option-text table th,
.explanation-content table th,
.question-text table th,
.explanation-text table th {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
    font-weight: bold;
}

.question-title table td,
.option-text table td,
.explanation-content table td,
.question-text table td,
.explanation-text table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
}

.question-title table tr:hover,
.option-text table tr:hover,
.explanation-content table tr:hover,
.question-text table tr:hover,
.explanation-text table tr:hover {
    background: #f8f9fa;
}

/* Markdown水平线样式 */
.question-title hr,
.option-text hr,
.explanation-content hr,
.question-text hr,
.explanation-text hr {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 1em 0;
}

/* Markdown删除线样式 */
.question-title del,
.option-text del,
.explanation-content del,
.question-text del,
.explanation-text del,
.question-title s,
.option-text s,
.explanation-content s,
.question-text s,
.explanation-text s {
    text-decoration: line-through;
    color: #6c757d;
}

/* 任务列表样式 */
.question-title input[type="checkbox"],
.option-text input[type="checkbox"],
.explanation-content input[type="checkbox"],
.question-text input[type="checkbox"],
.explanation-text input[type="checkbox"] {
    margin-right: 0.5em;
}

/* KaTeX数学公式样式增强 */
.question-title .katex,
.option-text .katex,
.explanation-content .katex,
.question-text .katex,
.explanation-text .katex {
    font-size: 1.1em;
}

.question-title .katex-display,
.option-text .katex-display,
.explanation-content .katex-display,
.question-text .katex-display,
.explanation-text .katex-display {
    margin: 0.8em 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* 公式块样式 */
.question-title .katex-display > .katex,
.option-text .katex-display > .katex,
.explanation-content .katex-display > .katex,
.question-text .katex-display > .katex,
.explanation-text .katex-display > .katex {
    display: inline-block;
    padding: 0.5em 1em;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* 行内公式样式 */
.question-title .katex:not(.katex-display),
.option-text .katex:not(.katex-display),
.explanation-content .katex:not(.katex-display),
.question-text .katex:not(.katex-display),
.explanation-text .katex:not(.katex-display) {
    padding: 0 0.2em;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .question-title table,
    .option-text table,
    .explanation-content table,
    .question-text table,
    .explanation-text table {
        font-size: 0.9em;
    }
    
    .question-title table th,
    .option-text table th,
    .explanation-content table th,
    .question-text table th,
    .explanation-text table th,
    .question-title table td,
    .option-text table td,
    .explanation-content table td,
    .question-text table td,
    .explanation-text table td {
        padding: 6px 8px;
    }
    
    .question-title pre,
    .option-text pre,
    .explanation-content pre,
    .question-text pre,
    .explanation-text pre {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    /* 移动端数学公式调整 */
    .question-title .katex,
    .option-text .katex,
    .explanation-content .katex,
    .question-text .katex,
    .explanation-text .katex {
        font-size: 1em;
    }
    
    .question-title .katex-display,
    .option-text .katex-display,
    .explanation-content .katex-display,
    .question-text .katex-display,
    .explanation-text .katex-display {
        font-size: 0.95em;
    }
}

